x1="("
x2=")"
y1="["
y2="]"
z1="{"
z2="}"

a=input()
b=input()
c=input()
d=input()
f=input()
g=input()


if a==(x2 or y2 or z2):
    print ("False")
if g==(x1 or y1 or z1):
    print ("False")
if a==x1 and  b==x2 and c==y1 and  d==y2  and f==z1 and  g==z2:
    print("True")

